package com.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String execute() throws Exception {
		HttpServletRequest request=ServletActionContext.getRequest();
		String name=(String)request.getParameter("username");
		ActionContext.getContext().put("name", name);
		//System.out.println("name:"+name);
		request.getSession().setAttribute("username", name);
		return SUCCESS;
	}
}
